package com.i2works.smartluolong.utils.shiro.filter;

import org.apache.shiro.web.filter.authc.AnonymousFilter;
import org.apache.shiro.web.util.WebUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

/**
 * 用户登录跳转重定向拦截器
 *
 * @author koal <koal@vip.qq.com>
 * @date 2017/2/26 17:49
 */

public class UrlRedirectFilter extends AnonymousFilter {

    protected final Logger logger = LoggerFactory.getLogger(getClass());

    @Override
    protected boolean preHandle(ServletRequest request, ServletResponse response) throws Exception {
        //保存上一页请求
        WebUtils.saveRequest(request);
        return super.preHandle(request, response);
    }

}
